#include "Container.h"


Container::Container()
{
}

Container::~Container()
{
}//missing 1/2

int Container::get_size()
{
    return c.size();
}

int Container::add_item(const std::string& str)
{
    for(unsigned int i = 0 ; i < c.size() ; i++)
    {
        if(c[i] == str)
            return -1;
    }
    c.insert(c.end(),str);
    return (c.size()-1);
}

string Container::get_item(int index)
{
    int size=(int )c.size();   
    if(index >= size || index < 0)
        throw IncompatibleContainerError();//missing 1/2 branch.
    return c[index];
}

bool Container::remove_item( int index)
{
    int size=(int )c.size();
    if(index >= size || index < 0)
        return false;
    c.erase(c.begin() + index);//missing 3/6
    return true;
}
